//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.ruoyi.live.tool.utils;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

public class PicUtils {
    public PicUtils() {
    }

    public static Map<String, Integer> getImgSize(String path) {
        InputStream is = null;
        BufferedImage src = null;
        Map<String, Integer> res = new HashMap();
        res.put("width", 0);
        res.put("height", 0);

        try {
            File file = new File(path);
            is = new FileInputStream(file);
            src = ImageIO.read(is);
            res.put("width", src.getWidth((ImageObserver)null));
            res.put("height", src.getHeight((ImageObserver)null));
        } catch (Exception var13) {
            var13.printStackTrace();
        } finally {
            try {
                is.close();
            } catch (IOException var12) {
                var12.printStackTrace();
            }

        }

        return res;
    }
}
